package com.qph.base.model;

import java.io.Serializable;
import java.util.List;

public class Pagination implements Serializable{
	private static final long serialVersionUID = 1L;
	
	private int pageSize = 10; //每页显示记录数
	private int totalPage;		//总页数
	private int total;	//总记录数
	private int pageNumber;	//当前页
	private String sort;
	private String order;
	
	private List<?> rows;
	
	public List<?> getRows() {
		return rows;
	}
	public void setRows(List<?> rows) {
		this.rows = rows;
	}
	
	public int getCurrentPage() {
		if(pageNumber<=0)
			pageNumber = 1;
		if(pageNumber>getTotalPage())
			pageNumber = getTotalPage();
		return pageNumber;
	}
	public void setCurrentPage(int currentPage) {
		this.pageNumber = currentPage;
	}
	
	
	public int getTotalPage() {
		if(total%pageSize==0)
			totalPage = total/pageSize;
		else
			totalPage = total/pageSize+1;
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int PageSize() {
		return pageSize;
	}
	public void setShowCount(int showCount) {
		this.pageSize = showCount;
	}
	public String getSort() {
		return sort;
	}
	public void setSort(String sort) {
		this.sort = sort;
	}
	public String getOrder() {
		return order;
	}
	public void setOrder(String order) {
		this.order = order;
	}
	
}
